var Badge = (function() {
    var instance;
    var newBadge = function() {
        return {
            "turnActive": function() {
                chrome.browserAction.setBadgeText({text: "" + (Player.getInstance().getCurrentPosition() + 1)});
                chrome.browserAction.setBadgeBackgroundColor({color: [255, 165, 0, 200]});
            },
            "turnIdle": function() {
                chrome.browserAction.setBadgeText({text: "" + Player.getInstance().getPlaylist().length});
                chrome.browserAction.setBadgeBackgroundColor({color: [64, 64, 64, 200]});
            }
        };
    }
    return {
        getInstance: function() {
            if (instance === undefined) {
                instance = newBadge();
            }
            return instance;
        }
    }
})();